<%--
  Created by IntelliJ IDEA.
  User: Kazak
  Date: 2025/4/20
  Time: 23:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>用户界面示例</title>
  <link rel="stylesheet" href="${pageContext.request.contextPath}/desktop/home/css/home.css">
  <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
  <script src="${pageContext.request.contextPath}/js/display.js"></script>
  <script>
    window.onload = function() {
      const xhr = new XMLHttpRequest();
      xhr.open("POST", "./auth/VerifyToken", true);
      xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      token = localStorage.getItem("token")
      console.log(token);

      xhr.onreadystatechange = function() {
        if (xhr.readyState === 4) {
          if (xhr.status === 200) {
            console.log("OK")
            document.getElementById("uname").textContent = localStorage.getItem("uname");
          }else {
            console.log("NO");
            alert("登录验证过期，请重新登录！")
            window.location.href = "${pageContext.request.contextPath}/";
          }
        }
      };

      xhr.send("token=" + token);
    }
  </script>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
</head>
<body>
<header>
  <i class="bi bi-three-dots" id="bi-three-dots" onclick=""></i>
  <i class="bi bi-bag-fill" id="bi-bag-fill"></i>

  <div class="actions">
    <i class="bi bi-person-circle" style="font-size: 32px;margin-left: 5px;" class="sidebarFunction"></i>
    <p id="uname">?</p>
    <a href="#">帮助</a>
    <a href="#">设置</a>
  </div>
</header>
<div class="sidebar">

  <div class="card" style="margin-top: 52px;">
    <h3 onclick="display('search')" class="tables">查询类</h3>
    <ul class="search" style="display: none;">
      <li onclick="window.location.href = '#';">查询资产证书</li>
      <li onclick="window.location.href = '#';">查询厂商</li>
      <li onclick="window.location.href = '#';">资产回溯</li>
      <li onclick="window.location.href = '#';">转入资产</li>
      <li onclick="window.location.href = '#';">转出资产</li>
    </ul>
  </div>
  <div class="card" >
    <h3 onclick="display('management')" class="tables">产品管理</h3>
    <ul class="management" style="display: none;">
      <li onclick="window.location.href = '#';">注册产品</li>
      <li onclick="window.location.href = '#';">上架产品</li>
      <li onclick="window.location.href = '#';">下架产品</li>
      <li onclick="window.location.href = '#';">修改产品价格</li>
      <li onclick="window.location.href = '#';">上传产品信息</li>
    </ul>
  </div>
  <div class="card" >
    <h3 onclick="display('upload')" class="tables">上传类</h3>
    <ul class="upload" style="display: none;">
      <li onclick="window.location.href = '#';">上传证书</li>
      <li onclick="window.location.href = '#';">上传报告</li>
    </ul>
  </div>
  <div class="card" >
    <h3 onclick="display('getMessage')" class="tables">信息收集与API</h3>
    <ul class="getMessage" style="display: none;">
      <li onclick="window.location.href = '#';">收集用户信息</li>
      <li onclick="window.location.href = '#';">接入第三方API</li>
    </ul>
  </div>
  <div class="card" >
    <h3 onclick="display('permissions')" class="tables">权限管理</h3>
    <ul class="permissions" style="display: none;">
      <li onclick="window.location.href = '#';">释放临时权限</li>
    </ul>
  </div>
  <div class="card" >
    <h3 onclick="display('aduit')" class="tables">审核类</h3>
    <ul class="aduit" style="display: none;">
      <li onclick="window.location.href = '#';">审核证书及报告</li>
      <li onclick="window.location.href = '#';">审核第三方企业发布的内容</li>
      <li onclick="window.location.href = '#';">审核平台内容</li>
    </ul>
  </div>
  <div class="card" >
    <h3 onclick="display('users')" class="tables">用户管理</h3>
    <ul class="users" style="display: none;">
      <li onclick="window.location.href = '#';">控制用户登录注册</li>
      <li onclick="window.location.href = '#';">限制用户权限</li>
      <li onclick="window.location.href = '#';">删除产品</li>
      <li onclick="window.location.href = '#';">删除用户</li>
      <li onclick="window.location.href = '#';">删除资产</li>
    </ul>
  </div>
  <div class="card">
    <h3 onclick="display('Manage')" class="tables">高级管理</h3>
    <ul class="Manage" style="display: none;">
      <li onclick="window.location.href = '#';">远程访问区块链系统控制台</li>
    </ul>
  </div>
</div>
<div id="main" class="main">
  <div id="page" class="page">
    <div class="urls">
      <p>你的位置：</p>
      <a href="${pageContext.request.contextPath}/">/查询类/</a>
    </div>
    <div class="maintext">

    </div>
  </div>
</div>

</div>
</body>
</html>
